package com.jt.controller;

import com.jt.pojo.Content;
import com.jt.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author dc
 * @Classname IndexController
 * @Date 2020/2/22 11:40
 */
@Controller
public class IndexController {

    @Autowired
    private ContentService contentService;

    /**
     * 跳转系统首页(携带广告模型)
     * @return 首页名
     */
    @RequestMapping("/")
    public String index( Model model){
        String bigContent = contentService.getContentList();
        List<Content> news=contentService.getNews();
        model.addAttribute("indexAD1",bigContent);
        model.addAttribute("news",news);
        return "index";
    }


}
